/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * WNSimGuideIntroFrame.java
 *
 * Created on 23 Ιουν 2009, 12:02:51 μμ
 */

package gui;

import java.awt.Dimension;
import java.awt.Font;
import java.awt.Toolkit;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;


/**
 * The intro frame that guides the user through the simulation settings
 * @author Arvanitis Ioannis
 */
public class WNSimGuideIntroFrame extends javax.swing.JFrame {

    /** 
     * Creates new form WNSimGuideIntroFrame
     */
    public WNSimGuideIntroFrame() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroupConfig = new javax.swing.ButtonGroup();
        jPanelIntro = new javax.swing.JPanel();
        jLabelWelcome = new javax.swing.JLabel();
        jLabelWelcomeDetails = new javax.swing.JLabel();
        jButtonIntro = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jLabelConfig = new javax.swing.JLabel();
        jRadioButtonDefault = new javax.swing.JRadioButton();
        jRadioButtonNew = new javax.swing.JRadioButton();
        jRadioButtonCustom = new javax.swing.JRadioButton();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        openMenuItem = new javax.swing.JMenuItem();
        saveMenuItem = new javax.swing.JMenuItem();
        saveAsMenuItem = new javax.swing.JMenuItem();
        exitMenuItem = new javax.swing.JMenuItem();
        editMenu = new javax.swing.JMenu();
        cutMenuItem = new javax.swing.JMenuItem();
        copyMenuItem = new javax.swing.JMenuItem();
        pasteMenuItem = new javax.swing.JMenuItem();
        deleteMenuItem = new javax.swing.JMenuItem();
        helpMenu = new javax.swing.JMenu();
        contentsMenuItem = new javax.swing.JMenuItem();
        aboutMenuItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("WNSim Guide Intro - Οδηγός Προσομοίωσης Ασυρμάτων Δικτύων");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setMinimumSize(new java.awt.Dimension(500, 220));
        setResizable(false);

        jPanelIntro.setLayout(null);

        jLabelWelcome.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabelWelcome.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelWelcome.setText("Welcome to the Wireless Network Simulator");
        jLabelWelcome.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jPanelIntro.add(jLabelWelcome);
        jLabelWelcome.setBounds(0, 10, 472, 30);

        jLabelWelcomeDetails.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabelWelcomeDetails.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelWelcomeDetails.setText("Set your preferred options and simulate easily and quickly your wireless network !!");
        jPanelIntro.add(jLabelWelcomeDetails);
        jLabelWelcomeDetails.setBounds(0, 50, 470, 30);

        jButtonIntro.setText("Proceed");
        jButtonIntro.setToolTipText("proceeds to main option frame");
        jButtonIntro.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButtonIntroMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButtonIntroMouseExited(evt);
            }
        });
        jButtonIntro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonIntroActionPerformed(evt);
            }
        });
        jPanelIntro.add(jButtonIntro);
        jButtonIntro.setBounds(190, 190, 100, 30);
        jPanelIntro.add(jSeparator1);
        jSeparator1.setBounds(0, 90, 470, 2);

        jLabelConfig.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelConfig.setText("Choose configuration :");
        jPanelIntro.add(jLabelConfig);
        jLabelConfig.setBounds(10, 100, 140, 14);

        buttonGroupConfig.add(jRadioButtonDefault);
        jRadioButtonDefault.setText("Load default configuration file");
        jPanelIntro.add(jRadioButtonDefault);
        jRadioButtonDefault.setBounds(20, 120, 220, 23);

        buttonGroupConfig.add(jRadioButtonNew);
        jRadioButtonNew.setSelected(true);
        jRadioButtonNew.setText("Create new configuration file");
        jPanelIntro.add(jRadioButtonNew);
        jRadioButtonNew.setBounds(20, 140, 220, 23);

        buttonGroupConfig.add(jRadioButtonCustom);
        jRadioButtonCustom.setText("Load a custom configuration file");
        jPanelIntro.add(jRadioButtonCustom);
        jRadioButtonCustom.setBounds(20, 160, 220, 23);

        menuBar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                menuBarMouseEntered(evt);
            }
        });

        fileMenu.setText("File");

        openMenuItem.setText("Open");
        fileMenu.add(openMenuItem);

        saveMenuItem.setText("Save");
        fileMenu.add(saveMenuItem);

        saveAsMenuItem.setText("Save As ...");
        fileMenu.add(saveAsMenuItem);

        exitMenuItem.setText("Exit");
        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        editMenu.setText("Edit");

        cutMenuItem.setText("Cut");
        editMenu.add(cutMenuItem);

        copyMenuItem.setText("Copy");
        editMenu.add(copyMenuItem);

        pasteMenuItem.setText("Paste");
        editMenu.add(pasteMenuItem);

        deleteMenuItem.setText("Delete");
        editMenu.add(deleteMenuItem);

        menuBar.add(editMenu);

        helpMenu.setText("Help");

        contentsMenuItem.setText("Contents");
        helpMenu.add(contentsMenuItem);

        aboutMenuItem.setText("About");
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelIntro, javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelIntro, javax.swing.GroupLayout.DEFAULT_SIZE, 223, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitMenuItemActionPerformed

    private void jButtonIntroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonIntroActionPerformed
        if (jRadioButtonNew.isSelected()) {
            new WNSimGuideMainFrame();
        }
        else if (jRadioButtonDefault.isSelected()) {
        //////////////////////////////////////////
        }
        else if (jRadioButtonNew.isSelected()) {
        //////////////////////////////////////////
        }
        dispose();
}//GEN-LAST:event_jButtonIntroActionPerformed

    private void menuBarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_menuBarMouseEntered
    }//GEN-LAST:event_menuBarMouseEntered

    private void jButtonIntroMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonIntroMouseEntered
        jButtonIntro.setFont(new Font(null, Font.BOLD, 11));
    }//GEN-LAST:event_jButtonIntroMouseEntered

    private void jButtonIntroMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonIntroMouseExited
        jButtonIntro.setFont(new Font(null, Font.PLAIN, 11));
    }//GEN-LAST:event_jButtonIntroMouseExited

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                } catch (ClassNotFoundException ex) {
                    Logger.getLogger(WNSimGuideIntroFrame.class.getName()).log(Level.SEVERE, null, ex);
                } catch (InstantiationException ex) {
                    Logger.getLogger(WNSimGuideIntroFrame.class.getName()).log(Level.SEVERE, null, ex);
                } catch (IllegalAccessException ex) {
                    Logger.getLogger(WNSimGuideIntroFrame.class.getName()).log(Level.SEVERE, null, ex);
                } catch (UnsupportedLookAndFeelException ex) {
                    Logger.getLogger(WNSimGuideIntroFrame.class.getName()).log(Level.SEVERE, null, ex);
                }
                WNSimGuideIntroFrame frame = new WNSimGuideIntroFrame();
                Toolkit toolkit = Toolkit.getDefaultToolkit();
                Dimension screensize = toolkit.getScreenSize();
                Dimension framesize = frame.getSize();
                int x = (int) ( screensize.getWidth() - frame.getWidth() ) / 2;
                int y = (int) ( screensize.getHeight() - frame.getHeight() ) / 2;
                frame.setLocation( x, y );
                frame.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.ButtonGroup buttonGroupConfig;
    private javax.swing.JMenuItem contentsMenuItem;
    private javax.swing.JMenuItem copyMenuItem;
    private javax.swing.JMenuItem cutMenuItem;
    private javax.swing.JMenuItem deleteMenuItem;
    private javax.swing.JMenu editMenu;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JButton jButtonIntro;
    private javax.swing.JLabel jLabelConfig;
    private javax.swing.JLabel jLabelWelcome;
    private javax.swing.JLabel jLabelWelcomeDetails;
    private javax.swing.JPanel jPanelIntro;
    private javax.swing.JRadioButton jRadioButtonCustom;
    private javax.swing.JRadioButton jRadioButtonDefault;
    private javax.swing.JRadioButton jRadioButtonNew;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenuItem openMenuItem;
    private javax.swing.JMenuItem pasteMenuItem;
    private javax.swing.JMenuItem saveAsMenuItem;
    private javax.swing.JMenuItem saveMenuItem;
    // End of variables declaration//GEN-END:variables

}
